<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>设置</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../css/style.css"/>
      <style>
          .setting{width: 100%;}
          .content{padding-top: 50px}
          .hr{width: 100%;height: 10px;background-color:  #F7F8FA;}
          .clear{padding: 18px 20px;display: flex;justify-content: space-between;align-items: center;}
          .clear .title{font-size: 15px;color: #000}
          .clear .desc{display: flex;align-items: center;}
          .clear .desc span{font-size: 15px;color: #999}
          .clear .desc img{width: 6px;height: 10px;margin-left: 8px;}
          .loginout{widows: 100px;text-align: center;color: #FBBB3F;font-size: 15px;line-height: 60px;}
      </style>
  </head>
  <body>
    <div class="setting">
      <div class="returnBox">
        <div class="return"> <img src="../image/return.png" onclick="api.closeWin()"> <span class="us">系统通知</span></div>
      </div>
      <div class="content">
        <div class="hr"></div>
        <div class="clear">
          <div class="title">清除缓存</div>
          <div class="desc"><span id="num">84.5K</span><img src="../image/more.png" alt=""></div>
        </div>
        <div class="hr"></div>
        <div class="loginout">退出登录</div>
      </div>
    </div>
  </body>
  </html>
  <script type="text/javascript" src="../script/api.js"></script>

  <script type="text/javascript">
  apiready = function(){
    $api.fixStatusBar($api.dom('.setting'));

    $api.addEvt($api.dom('.clear'), 'click', function(){
      $api.html($api.byId('num'), '0K');
      clearInterval(timeOut)

    });

    function funcGoto(){
      window.location.reload()
    }

    $api.addEvt($api.dom('.loginout'), 'click', function(){
      $api.clearStorage();
      var jsfun = 'funcGoto()';
      api.execScript({
        name: 'root',
        frameName: 'frame3',
        script: jsfun
      });
      api.closeWin();

    });


  };
  var cache,timeOut = null;

  $api.setStorage('cache',0);
  function num(){
    timeOut = setInterval(add(),1000)
    function add(){
      cache= (Math.random()*50).toFixed(1) + $api.getStorage('cache');
      $api.setStorage('cache',cache)

    }
  }
  num()
  $api.html($api.byId('num'), $api.getStorage('cache')+'k');
  </script>
